/*
 * Util.java
 *
 * Created on 27 de Maio de 2006, 12:55
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package hubsniffer.db.util;

/**
 *
 * @author Daniel Botelho
 */
public class Util {
    
    public static String escapeString(String source) {
        StringBuffer sb = new StringBuffer();
        if(source!=null){
            for(int i = 0; i < source.length(); i++){
                if(source.charAt(i)=='\'')
                    sb.append('\\');
                if(source.charAt(i)=='\\')
                    sb.append('\\');
                sb.append(source.charAt(i));
            }
        }
        return sb.toString();
    }
    
}
